﻿namespace S7_3UBD
{
    public class LogDBAccess : DBAccessBase
    {
        public void Add(Base_Log entity)
        {
            using (var context = GetDBContext())
            {
                entity.Id = Guid.NewGuid().ToString();
                entity.CreateTime = DateTime.Now;
                context.Base_Log.Add(entity);
                context.SaveChanges();
            }
        }

        public void Add(Base_Log entity, TZ1989DBContext context)
        {
            entity.Id = Guid.NewGuid().ToString();
            entity.CreateTime = DateTime.Now;
            context.Base_Log.Add(entity);
        }
    }
}
